package com.example.plan;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.Toast;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

	ImageButton button;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_item_empty_plan);
//        final LinearLayout mainLayout = (LinearLayout) findViewById(R.id.mainLayout);
//        button = (ImageButton) findViewById(R.id.ibAddPlan);
        
      
//        mainLayout.setOnClickListener(new OnClickListener() {
//			
//			public void onClick(View v) {
////				Toast.makeText(MainActivity.this, "dsfsdfds", 1000).show();
////					button.setSelected(true);
//					button.setPressed(true);
////					button.setClickable(true);
////					button.set
//					
//			}
//		});
//        
        mainLayout.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				if (event.getAction()==MotionEvent.ACTION_DOWN) {
					button.setPressed(true);
					Log.e("ACTION_DOWN--------", "ACTION_DOWN");

				}else if(event.getAction()==MotionEvent.ACTION_UP){
					Log.e("up--------", "up");
					button.setPressed(false);
				}else if (event.getAction()==MotionEvent.ACTION_MOVE) {
					Log.e("ACTION_MOVE--------", "ACTION_MOVE");
//					http://androidstudy.iteye.com/blog/836358
				}
				return false;
			}
		});
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    
}
